package com.yztstudy.Service.Impl;

import com.yztstudy.Entity.Item;
import com.yztstudy.Mapper.ItemMapper;
import com.yztstudy.Service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ItemServiceImpl implements ItemService {

    @Autowired
    private ItemMapper itemMapper;

    @Override
    public Integer addItem(Item item) {
        return itemMapper.addItem(item);
    }

    @Override
    public List<Item> getItemsByOrderID(Integer orderID) {
        return itemMapper.getItemsByOrderID(orderID);
    }

    @Override
    public Integer deleteItemsByOrderId(Integer orderID) {
        return itemMapper.deleteItemsByOrderId(orderID);
    }
}
